glActiveTexture (GL_TEXTURE0);
glUniform1i(program->map_location, 0); /* Use texture unit 0 */
- glEnableVertexAttribArray (0);
- glEnableVertexAttribArray (1);
+ glEnableVertexAttribArray (program->position_location);
+ glEnableVertexAttribArray (program->uv_location);
glBindBuffer (GL_ARRAY_BUFFER, paint_data->tmp_vertex_buffer);
glVertexAttribPointer (program->position_location, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 4, NULL);
g_free (vertex_buffer_data);
- glDisableVertexAttribArray (0);
- glDisableVertexAttribArray (1);
+ glDisableVertexAttribArray (program->position_location);
+ glDisableVertexAttribArray (program->uv_location);
}
/* x,y,width,height describes a rectangle in the gl render buffer
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glEnable (GL_SCISSOR_TEST);
- glEnable (GL_TEXTURE_2D);
gdk_window_get_unscaled_size (impl_window, NULL, &unscaled_window_height);
if (alpha_size != 0)
glDisable (GL_BLEND);
- glDisable (GL_TEXTURE_2D);
-
#undef FLIP_Y
}
if (clip_region)
cairo_region_destroy (clip_region);
+
}
/* This is always called with the paint context current */
float umax, vmax;
gboolean use_texture_rectangle;
guint target;
-
paint_context = gdk_gl_context_get_current ();
if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW_SURFACE) == 0 &&
paint_context &&
target = GL_TEXTURE_2D;
glBindTexture (target, texture_id);
- glEnable (target);
glEnable (GL_SCISSOR_TEST);
glTexParameteri (target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
}
}
-
glDisable (GL_SCISSOR_TEST);
- glDisable (target);
glDeleteTextures (1, &texture_id);
}
glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
glPixelStorei (GL_UNPACK_ROW_LENGTH, cairo_image_surface_get_stride (image_surface)/4);
- glTexImage2D (texture_target, 0, 4, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
+ glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
cairo_image_surface_get_data (image_surface));
glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
}